package org.br.erp.base.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.br.erp.base.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import org.br.erp.base.vo.ScmPartnerVO;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 往来单位
 * @Author: jeecg-boot
 * @Date:   2022-08-20
 * @Version: V1.0
 */
public interface IScmpartnerService extends IService<Scmpartner> {

    List<Scmpartner> getPartnerList(String partnertype);

    List<ScmPartnerVO> getPartnerVoList(IPage<ScmPartnerVO>page, QueryWrapper<ScmPartnerVO> queryWrapper);


    Scmpartner getPartnerByName(String partnername);


    /**
     * 添加一对多
     *
     * @param scmpartner
     * @param scmpartnerbaseList
     * @param scmpartnerlinkmanList
     * @param scmpartneraddressitemList
     * @param scmpartnerattachList
     */
    public void saveMain(Scmpartner scmpartner,List<Scmpartnerbase> scmpartnerbaseList,List<Scmpartnerlinkman> scmpartnerlinkmanList,List<Scmpartneraddressitem> scmpartneraddressitemList,List<Scmpartnerattach> scmpartnerattachList) ;

    /**
     * 修改一对多
     *
     * @param scmpartner
     * @param scmpartnerbaseList
     * @param scmpartnerlinkmanList
     * @param scmpartneraddressitemList
     * @param scmpartnerattachList
     */
    public void updateMain(Scmpartner scmpartner, List<Scmpartnerbase> scmpartnerbaseList, List<Scmpartnerlinkman> scmpartnerlinkmanList, List<Scmpartneraddressitem> scmpartneraddressitemList, List<Scmpartnerattach> scmpartnerattachList);


    /**
     * 删除一对多
     *
     * @param id
     */
    public void delMain (String id);

    /**
     * 批量删除一对多
     *
     * @param idList
     */
    public void delBatchMain (Collection<? extends Serializable> idList);


    public void updateLinkMan(List<Scmpartnerlinkman> scmpartnerlinkmanList);


    public void updateAddress(List<Scmpartneraddressitem> scmpartneraddressitemList);
}
